#ifndef PROGRESSGAME_H
#define PROGRESSGAME_H

#include <QProgressBar>

#include <QTimer>

#include <QKeyEvent>

#include "games/basegame.h"

// ProgressGame: click A and S repetedly to increase the progressbar
class ProgressGame : public BaseGame
{
    Q_OBJECT
public:
    // constructor
    explicit ProgressGame(QWidget *parent = 0, int difflvl = 1);

    // Members
    bool isSolved() { if(progbar->value() < 99) return false; return true; }
    QString hint() { return "You just lose points."; }

    // Intercept key events
    void keyPressEvent(QKeyEvent* key_event);
public slots:
    // Timeout slot
    void timerTimeout();

private:
    QProgressBar * progbar;

    QTimer * timer;

    int last_key;
};

#endif // PROGRESSGAME_H
